#pragma once

#include <Windows.h>
#include <iostream>
#include <string>

using namespace std;

class CWin32Dialog
{
public:
	CWin32Dialog(void);
	virtual ~CWin32Dialog(void);
	void InitResource(int id);
	void InitResource(wstring wStrId);
	INT_PTR DoModal(HINSTANCE hInstance = NULL, HWND hParent = NULL);
	void CreateWnd(HINSTANCE hInstance = NULL, HWND hParent = NULL);
	void HideWindow();
	void SetDialogTransparentColor(COLORREF color);
	void SetDialogTransparentAlpha(int alpha);
	void SetTopMost();
	void SetNoTopMost();
	HWND GetHWnd();
	bool IsTopMost();
	void RemoveTaskbar();
	wstring GetDlgItemText(int dlgItemId);

protected:
	virtual int HandleMessage(int uMsg, WPARAM wParam, LPARAM lParam);
	void SetWndProcReturnValue(int value);
	int GetWmCommandMsgBtnCtrlId(WPARAM wParam);

private:
	static INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	static DWORD WINAPI ThreadFunc(LPVOID param);

private:
	int m_srcId;
	wstring m_wStrId;

private:
	HWND m_hWnd;
	bool m_isTopMost;
};

